package com.zzty.training.dao;

import com.zzty.training.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserDao {
    @Select("select * from user where name=#{name}")
    User getUserByName(User user);
    @Select("select * from user where name=#{name} or email=#{email}")
    User getUserByNameOrEmail(User user);
    @Insert("insert into user (name,password,type,email,clazzid) values (#{name},#{password},'student',#{email},#{clazzid})")
    Integer addUser(User user);
    @Update("update user  set name=#{name},password=#{password},email=#{email} where id=#{id}")
    Integer updateUser(User user);
}
